/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.produccion.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author CARLOS
 */
@Entity
@Table(name = "inyprod_planillaproducciondet", catalog = "base_produccion", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "InyprodPlanillaproducciondet.findAll", query = "SELECT i FROM InyprodPlanillaproducciondet i"),
    @NamedQuery(name = "InyprodPlanillaproducciondet.findByIdPlanilla", query = "SELECT i FROM InyprodPlanillaproducciondet i WHERE i.idPlanilla = :idPlanilla"),
    @NamedQuery(name = "InyprodPlanillaproducciondet.findByNumdoc2", query = "SELECT i FROM InyprodPlanillaproducciondet i WHERE i.numdoc2 = :numdoc2"),
    @NamedQuery(name = "InyprodPlanillaproducciondet.findByNumdoc", query = "SELECT i FROM InyprodPlanillaproducciondet i WHERE i.numdoc = :numdoc"),
    @NamedQuery(name = "InyprodPlanillaproducciondet.findByPeriodo", query = "SELECT i FROM InyprodPlanillaproducciondet i WHERE i.periodo = :periodo"),
    @NamedQuery(name = "InyprodPlanillaproducciondet.findByGlosa", query = "SELECT i FROM InyprodPlanillaproducciondet i WHERE i.glosa = :glosa"),
    @NamedQuery(name = "InyprodPlanillaproducciondet.findByCantidad", query = "SELECT i FROM InyprodPlanillaproducciondet i WHERE i.cantidad = :cantidad"),
    @NamedQuery(name = "InyprodPlanillaproducciondet.findByNumMaster", query = "SELECT i FROM InyprodPlanillaproducciondet i WHERE i.numMaster = :numMaster"),
    @NamedQuery(name = "InyprodPlanillaproducciondet.findByDoccruce", query = "SELECT i FROM InyprodPlanillaproducciondet i WHERE i.doccruce = :doccruce"),
    @NamedQuery(name = "InyprodPlanillaproducciondet.findByUnidad", query = "SELECT i FROM InyprodPlanillaproducciondet i WHERE i.unidad = :unidad"),
    @NamedQuery(name = "InyprodPlanillaproducciondet.findByFecha", query = "SELECT i FROM InyprodPlanillaproducciondet i WHERE i.fecha = :fecha"),
    @NamedQuery(name = "InyprodPlanillaproducciondet.findByCodusu", query = "SELECT i FROM InyprodPlanillaproducciondet i WHERE i.codusu = :codusu")})
public class InyprodPlanillaproducciondet implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idPlanilla", nullable = false)
    private Integer idPlanilla;
    @Column(name = "numdoc2", length = 15)
    private String numdoc2;
    @Column(name = "numdoc", length = 20)
    private String numdoc;
    @Column(name = "Periodo", length = 6)
    private String periodo;
    @Column(name = "glosa", length = 225)
    private String glosa;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "cantidad", precision = 22)
    private Double cantidad;
    @Column(name = "NumMaster")
    private Integer numMaster;
    @Column(name = "doccruce", length = 20)
    private String doccruce;
    @Column(name = "unidad", length = 5)
    private String unidad;
    @Column(name = "fecha")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @Column(name = "codusu", length = 20)
    private String codusu;
    @JoinColumn(name = "idcodpro", referencedColumnName = "idcodpro")
    @ManyToOne
    private Producto idcodpro;

    public InyprodPlanillaproducciondet() {
    }

    public InyprodPlanillaproducciondet(Integer idPlanilla) {
        this.idPlanilla = idPlanilla;
    }

    public Integer getIdPlanilla() {
        return idPlanilla;
    }

    public void setIdPlanilla(Integer idPlanilla) {
        this.idPlanilla = idPlanilla;
    }

    public String getNumdoc2() {
        return numdoc2;
    }

    public void setNumdoc2(String numdoc2) {
        this.numdoc2 = numdoc2;
    }

    public String getNumdoc() {
        return numdoc;
    }

    public void setNumdoc(String numdoc) {
        this.numdoc = numdoc;
    }

    public String getPeriodo() {
        return periodo;
    }

    public void setPeriodo(String periodo) {
        this.periodo = periodo;
    }

    public String getGlosa() {
        return glosa;
    }

    public void setGlosa(String glosa) {
        this.glosa = glosa;
    }

    public Double getCantidad() {
        return cantidad;
    }

    public void setCantidad(Double cantidad) {
        this.cantidad = cantidad;
    }

    public Integer getNumMaster() {
        return numMaster;
    }

    public void setNumMaster(Integer numMaster) {
        this.numMaster = numMaster;
    }

    public String getDoccruce() {
        return doccruce;
    }

    public void setDoccruce(String doccruce) {
        this.doccruce = doccruce;
    }

    public String getUnidad() {
        return unidad;
    }

    public void setUnidad(String unidad) {
        this.unidad = unidad;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public String getCodusu() {
        return codusu;
    }

    public void setCodusu(String codusu) {
        this.codusu = codusu;
    }

    public Producto getIdcodpro() {
        return idcodpro;
    }

    public void setIdcodpro(Producto idcodpro) {
        this.idcodpro = idcodpro;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPlanilla != null ? idPlanilla.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InyprodPlanillaproducciondet)) {
            return false;
        }
        InyprodPlanillaproducciondet other = (InyprodPlanillaproducciondet) object;
        if ((this.idPlanilla == null && other.idPlanilla != null) || (this.idPlanilla != null && !this.idPlanilla.equals(other.idPlanilla))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.produccion.entity.InyprodPlanillaproducciondet[ idPlanilla=" + idPlanilla + " ]";
    }
    
}
